<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
	<link type="text/css" rel="stylesheet" href="./css/manage/style.css">
	<link rel="stylesheet" href="<%=basePath%>/css/ztreecss/zTreeStyle/zTreeStyle.css" type="text/css">
	<script type="text/javascript" src="<%=basePath%>/script/jquery-1.6.2.min.js"></script>
	<script type="text/javascript" src="<%=basePath%>/script/ztreejs/jquery.ztree.core-3.3.min.js"></script>
	<script type="text/javascript" src="<%=basePath%>/script/ztreejs/jquery.ztree.excheck-3.3.min.js"></script>
	<script type="text/javascript" src="<%=basePath%>/script/ztreejs/jquery.ztree.exedit-3.3.min.js"></script>
	<script type="text/javascript" src="<%=basePath%>/script/manage/bankschaptertips.js"></script>
	<SCRIPT type="text/javascript">
		jQuery(document).ready(function(){
			settingbanks.check.chkboxType = { "Y" : "", "N" : "" };
			settingchaptertips.check.chkboxType = { "Y" : "", "N" : "" };
			jQuery.fn.zTree.init(jQuery("#bankstree"), settingbanks);
			jQuery.fn.zTree.init(jQuery("#chaptertipstree"), settingchaptertips);
			
		});
	</SCRIPT>
  </head>
  
  <body>
  	
    	<table width="100%" class="tab_comm">
				
				<tbody>
					<tr>
						<td width="200px">题库</td>
						<td width="200px">知识点</td>
					</tr>
					<tr>
					<td width="200px">
					<div class="content_wrap">
				    	<div class="zTreeDemoBackground left">
							<ul id="bankstree" class="ztree"></ul>
						</div>
				  	</div>
				  </td>
				  <td width="200px">
					  <div class="content_wrap">
					    <div class="zTreeDemoBackground left">
							<ul id="chaptertipstree" class="ztree"></ul>
						</div>
					  </div>
				  </td>
				  </tr>
					<tr>
						<td colspan="2">
						<span class="btnC"><input type="button" value="保存" class="btnC_text" onclick="_submit()"/></span>
						<span class="btnC"><input type="button" value="取消" class="btnC_text" onclick="javascript:window.location.href='./cas/types_index.action'" /></span>
						</td>
					</tr>
				</tbody>
		
    
  </body>
  <script type="text/javascript">
  		function _submit(){
  			var banks=gettreeid("bankstree");
  			var chaptertips=gettreeid("chaptertipstree");
  			window.location.href='<%=basePath%>cas/items_addsecond.action?bankstree='+banks+'&chaptertipstree='+chaptertips;
  		}
  		function gettreeid(name){
  			var $return="";
			var treeObj = $.fn.zTree.getZTreeObj(name);
  			var halfCheck = treeObj.getCheckedNodes(true);
  			for(var i=0;i<halfCheck.length;i++){
  				$return+=halfCheck[i].id+",";
  			}
  			return $return;
		}
  </script>

</html>